home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_olv_bossarena.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  197 lines

  1. # Jones 3D Cog Script
  2. #
  3. # olv_bassarena.cog
  4. #
  5. # Cog to lower snake idol into boss arena.
  6. #
  7. # [DS]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.     message    startup
  15.     message    activated
  16.     message    entered
  17.     message    pulse
  18.     
  19.     thing        totem1
  20.     thing        fallingpos                        nolink
  21.     thing        idol
  22.     thing        campos                        nolink
  23.     thing        lookit                        nolink
  24.     thing        actorlook                        nolink
  25.     thing        player                        local
  26.     int        stepped=0                         local
  27.     int        curcam                        local
  28.     int        sndplay                        local
  29.     int        vibe                            local
  30.     int        mus1_played=0                    local
  31.     int        mus1                            local
  32.     sound        stepsnd=inxj007.wav                local    #whoa!
  33.     sound        stopsnd=inxj048.wav                local    #why am i getting this creepy feeling?
  34.     sound        totemsnd=olv_quetzdoor_move_c.wav        local
  35.     sound        totemstop=olv_quetzdoor_stop_c.wav        local
  36.     sound        foundSnd=INXJ151.wav                local
  37.     sound        ahaSnd=INXJ147.wav                local # Aha...
  38.     sound        music0=mus_gen_awesome2.wav            local
  39. #    sound        music0=mus_gen_danger1.wav            local
  40.     sound        music1=mus_aet_pocket_teo.wav            local
  41.     cog        hints
  42.     vector    posoffset                        local
  43.     vector    angoffset                        local
  44.     vector    v_targetpos                        local
  45.  
  46.     #---------- Hal's Actor stuff ---------
  47.     thing       indyactor                            local
  48.     template    tpl_Indy=indy_sh_actor                local
  49.     sector    totem_top
  50.  
  51. end
  52.  
  53. # -------------------------------------------------------------------
  54. code
  55.  
  56. startup:
  57.     player = GetLocalPlayerThing(); 
  58.     SetThingLight(totem1, '0.6 0.6 0.5', 0.01, 0.01);
  59.     return;
  60.  
  61. entered:
  62.     if(GetSenderRef() == totem_top)
  63.     {
  64.     if(mus1_played == 1) return;
  65.     mus1_played=1;
  66.     mus1=PlaySoundLocal(music1, 1.0, 0.0, 0x0, 0);
  67.     }
  68.     return;
  69.  
  70. activated:
  71.     if((getsenderref() == idol) && (stepped == 0))
  72.     {
  73.     stepped = 1;
  74.     curCam = GetCurrentCamera();
  75.     StartCutscene(1);
  76.     SetActorFlags(player, 0x200000);
  77.     StopThing(player);
  78.     DeselectWeaponWait(player);
  79.     PlayVoice(player, ahaSnd, 1.0, 0);
  80.  
  81.     # ----- Set Cam Offset ---------
  82.     if (Rand() < 0.5)
  83.     {
  84.         SetExtCamOffset('0.15 -0.05 0.04');
  85.     }
  86.     else
  87.     {
  88.         SetExtCamOffset('-0.15 -0.05 0.04');
  89.     }
  90.     SetExtCamLookOffset('0.0 0.02 0.0');
  91.  
  92.       PlayMode(player, 60, 1);
  93.     DestroyThing(idol);
  94.  
  95.     # ----- Add Gold idol ---------
  96.     ChangeInv(player, 36, 100.0); # RT: Gold idol is worth 100
  97.     SetInvAvailable(player, 36, 1);
  98.     JonesInvItemChanged(35);
  99.     Sleep(1.0);
  100.     PlayVoice(player, foundSnd, 1.0, 0);
  101.  
  102.     # ----- Reset Camera ----------
  103.     RestoreExtCam();
  104.  
  105.     #--------------------------------------------------
  106.     #    Start descent into temple
  107.     #--------------------------------------------------
  108.     StopSound(mus1, 0.5);
  109.     SetPulse(0.1);
  110.     Sleep(1.0);
  111.     SendMessage(hints, user6);    # hint solved.
  112.         indyactor = CreateThing(tpl_Indy, player);
  113.         CaptureThing(indyactor);
  114.         CopyPlayerHolsters(player, indyactor);
  115.         SetThingFlags(player, 0x80000);
  116.         ClearThingFlags(indyactor, 0x80000);
  117.     PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
  118.     SetCameraFocus(2, campos);
  119.     SetCameraSecondaryFocus(2, lookit);
  120.     SetCameraPosInterp(2, 0);
  121.     SetCameraLookInterp(2, 0);
  122.     SetCurrentCamera(2);
  123.     SetCameraFOV(30, 0, 0);
  124.     SetCameraFOV(90, 1, 9);    
  125.         TeleportThing(indyactor, fallingpos);
  126.         AttachThingToThing(lookit, indyactor);
  127.         AISetLookThing(indyactor, actorlook);
  128.  
  129.     MoveToFrame(campos, 1, 0.9);
  130.     Movetoframe(totem1, 1, 1);
  131.     sndplay = PlaySoundThing(totemsnd, totem1, 0.8, 20, 55, 1);
  132.     sleep(0.5);
  133.     SetPulse(0.0);
  134.         PlayVoice(indyactor, stepsnd, 1.0, 0);
  135.     WaitForStop(totem1);
  136.     StopSound(sndplay, 0.01);
  137.         TeleportThing(player, indyactor);
  138.  
  139.     # Establish a camera position near Indy and prep follow-cam...            
  140.     v_targetpos =
  141.         VectorAdd(VectorTransformToOrient(player, '-0.25 -0.1 0.15'), GetThingPos(player));    
  142.     SetCameraPosition(1, v_targetpos);
  143.     sleep(0.01);
  144.  
  145.     PlaySoundThing(totemstop, totem1, 0.8, 20, 55, 0);
  146.     ClearThingFlags(player, 0x80000);
  147.     DestroyThing(indyactor);
  148.     SetCurrentCamera(curcam);
  149.     sleep(1.5);
  150.     PlayVoice(player, stopsnd, 1.0, 1);
  151.     ClearActorFlags(player, 0x200000);
  152.     EndCutscene();
  153.     }
  154.     return;
  155.  
  156. pulse:
  157.     vibe = RandBetween(1, 4);
  158.     if (vibe == 1)
  159.     {
  160.         posOffset = '-0.005 0.00 -0.001'; 
  161.         angOffset = '0.00 -0.001 0.001';
  162.     }
  163.     if (vibe == 2)
  164.     {
  165.         posOffset = '0.005 -0.002 0.001';
  166.         angOffset = '0.001 0.00 -0.001';
  167.     }
  168.     if (vibe == 3)
  169.     {
  170.         posOffset = '0.002 0.002 -0.002';
  171.         angOffset = '-0.001 0.002 -0.002';
  172.     }
  173.     if (vibe == 4)
  174.     {
  175.         posOffset = '-0.001 0.00 0.002';
  176.         angOffset = '0.00 0.00 0.001';
  177.     }
  178.     vibe = RandBetween(1, 3);
  179.     if (vibe == 1)
  180.     {
  181.         SetPulse(0.05);
  182.     }
  183.     if (vibe == 2)
  184.     {
  185.         SetPulse(0.1);
  186.     }
  187.     if (vibe == 3)
  188.     {
  189.         SetPulse(0.15);
  190.     }
  191.     SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
  192.     return;
  193.  
  194.  
  195. end
  196.  
  197.